package com.aaa.service.impl;

import com.aaa.dao.DeptDao;
import com.aaa.entity.Dept;
import com.aaa.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：admin
 * @date ：Created in 2022/6/27 20:33
 * @description：
 * @modified By：
 */

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptDao deptDao;

    @Override
    public List<Dept> findAllDept() {
        List<Dept> deptList = deptDao.findAllDept();
        return deptList;
    }

    @Override
    public int saveDept(Dept dept) {
        int saveNum = deptDao.saveDept(dept);
        return saveNum;
    }

    @Override
    public int deleteDeptById(Integer deptId) {
        int delNum = deptDao.deleteDeptById(deptId);
        return delNum;
    }

    @Override
    public int updateDept(Dept dept) {
        int updateNum = deptDao.updateDept(dept);
        return updateNum;
    }
}
